package maosy.oauth2.password.entities;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "tb_resource", schema = "hzjw_account")
public class TbResourceEntity {
    private String id;
    private String resourceName;
    private String resourceUrl;
    private String resourceDepict;
    private Short resourceSort;
    private Byte resourceLevel;
    private String resourceParentId;
    private byte resourceState;
    private Date createTime;
    private String operater;
    private Date updateTime;
    private byte isDelete;
    private String scope;

    @Id
    @Column(name = "id", nullable = false, length = 32)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "resource_name", nullable = false, length = 32)
    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    @Basic
    @Column(name = "resource_url", nullable = false, length = 255)
    public String getResourceUrl() {
        return resourceUrl;
    }

    public void setResourceUrl(String resourceUrl) {
        this.resourceUrl = resourceUrl;
    }

    @Basic
    @Column(name = "resource_depict", nullable = true, length = 255)
    public String getResourceDepict() {
        return resourceDepict;
    }

    public void setResourceDepict(String resourceDepict) {
        this.resourceDepict = resourceDepict;
    }

    @Basic
    @Column(name = "resource_sort", nullable = true)
    public Short getResourceSort() {
        return resourceSort;
    }

    public void setResourceSort(Short resourceSort) {
        this.resourceSort = resourceSort;
    }

    @Basic
    @Column(name = "resource_level", nullable = true)
    public Byte getResourceLevel() {
        return resourceLevel;
    }

    public void setResourceLevel(Byte resourceLevel) {
        this.resourceLevel = resourceLevel;
    }

    @Basic
    @Column(name = "resource_parent_id", nullable = true, length = 32)
    public String getResourceParentId() {
        return resourceParentId;
    }

    public void setResourceParentId(String resourceParentId) {
        this.resourceParentId = resourceParentId;
    }

    @Basic
    @Column(name = "resource_state", nullable = false)
    public byte getResourceState() {
        return resourceState;
    }

    public void setResourceState(byte resourceState) {
        this.resourceState = resourceState;
    }

    @Basic
    @Column(name = "create_time", nullable = true)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "operater", nullable = true, length = 32)
    public String getOperater() {
        return operater;
    }

    public void setOperater(String operater) {
        this.operater = operater;
    }

    @Basic
    @Column(name = "update_time", nullable = true)
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "is_delete", nullable = false)
    public byte getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(byte isDelete) {
        this.isDelete = isDelete;
    }

    @Basic
    @Column(name = "scope", nullable = false, length = 10)
    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbResourceEntity that = (TbResourceEntity) o;
        return resourceState == that.resourceState &&
                isDelete == that.isDelete &&
                Objects.equals(id, that.id) &&
                Objects.equals(resourceName, that.resourceName) &&
                Objects.equals(resourceUrl, that.resourceUrl) &&
                Objects.equals(resourceDepict, that.resourceDepict) &&
                Objects.equals(resourceSort, that.resourceSort) &&
                Objects.equals(resourceLevel, that.resourceLevel) &&
                Objects.equals(resourceParentId, that.resourceParentId) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(operater, that.operater) &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(scope, that.scope);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, resourceName, resourceUrl, resourceDepict, resourceSort, resourceLevel, resourceParentId, resourceState, createTime, operater, updateTime, isDelete, scope);
    }
}
